var retail;  //总单据明细
var retail_data;  //商品明细
var archives; //档案信息
var optometry; //验光信息
$(function(){
	//获取单据明细
	$.post(get_retail_info_url, {'sales_id':sales_id}, function (res) {
		if(res.code == 1) {
			layer.msg(res.msg);return false;
		}
		retail = res.data.retail;
		retail_data = res.data.retail_data;
		archives = retail.Archives;
		optometry = res.data.optometry;
		//设置用户信息
		var userinfo = [];
		userinfo.push('<li><span class="b"><i class="am-icon-user-md" style="margin-right:7px"></i>'+ archives.Realname +'</span>');
		userinfo.push('<span>电话：'+ archives.Mobile +'</span>');
		if(retail.PickUpType == 1) {
			userinfo.push('<span>取货方式：现场取货</span></li>');
		}else if(retail.PickUpType == 2) {
			userinfo.push('<span>取货方式：邮递取货</span></li>');
		}else if(retail.PickUpType == 3) {
			userinfo.push('<span>取货方式：指定时间取货</span></li>');
			userinfo.push('<li>预计取镜时间：<span class="orange-tips">'+ timetransDate(retail.HopePickUpTime) +'</span></li>');
		}
		userinfo.push('<li>销售员：'+ retail.BusinessName +'</li>');
		userinfo.push('<li>备注：<span class="orange-tips">'+ retail.Remarks +'</span></li>');
		$('#user-info').html(userinfo.join(''));

		//设置支付信息
		var pay_money_box = [];
		pay_money_box.push('<li>零售总金额：￥'+ formatnumber(retail.TotalMoney, "#,##0.00") +'</li>');
		pay_money_box.push('<li>应付金额：￥'+ formatnumber(retail.SumPayable, "#,##0.00") +'</li>');
		pay_money_box.push('<li>优惠金额：￥'+ formatnumber(retail.ChangesMoney, "#,##0.00") +'</li>');
		pay_money_box.push('<li>已付金额：￥'+ formatnumber(retail.AlreadyMoney, "#,##0.00") +'</li>');
		var needMoney = retail.SumPayable - retail.AlreadyMoney;
		pay_money_box.push('<li>待付款：<span style="color:red;">￥'+ formatnumber(needMoney, "#,##0.00") +'</span></li>');
		$('#pay_money_box').html(pay_money_box.join(''));

		//生成日志线
        if(res.data.log) {
			addlog(res.data.log);
		}
		//添加验光信息
		if(optometry) {
			var record = {};
			var optinfo = optometry;
			var chufang = optometry.chufang;
			if(chufang['far']) {
				record.far = {};
				record.far.right = chufang['far']['right'];
				record.far.left = chufang['far']['left'];
				record.far.tongju_yuan = record.far.left.total_pd_yuan;
			}

			if(chufang['near']) {
				record.near = {};
				record.near.right = chufang['near']['right'];
				record.near.left = chufang['near']['left'];
				record.near.tongju_jin = record.near.left.total_pd_jin;
			}
			if(chufang['yinxing']) {
				record.yinxing = {};
				record.yinxing.right = chufang['yinxing']['right'];
				record.yinxing.left = chufang['yinxing']['left'];
			}
			if(chufang['duojiaodian']) {
				record.duojiaodian = {};
				record.duojiaodian.right = chufang['duojiaodian']['right'];
				record.duojiaodian.left = chufang['duojiaodian']['left'];
				record.duojiaodian.tongju_yuan = record.duojiaodian.right.total_pd_yuan;
				record.duojiaodian.tongju_jin = record.duojiaodian.right.total_pd_jin;
			}
			var h = [];
			h.push('<div class="opt-info"><span>医生：'+ optinfo.Doctor +'</span><span>验光师：'+ optinfo.Optometrist +'</span></div>');
			$('#opt').find('.widget-body').html(h.join('') + addOptometry(record));
			$('#opt').show();
		}


		if(retail.PickUpType == 2) {
			$('#PostCompany').val(retail.PostCompany);
			$('#PostNumber').val(retail.PostNumber);
			$('#PostMoney').val(retail.PostMoney);
			$('#PostUser').val(retail.Archives.Realname);
			$('#PostMobile').val(retail.Archives.Mobile);
			$('#AddressName').val(retail.AddressName);
			$('#postinfo').show();
		}

		$.each(retail_data, function (index, value) {
			value.Products.Name = productGroupName(value.Products);
			value.subparams = [];
			if (value.Products.TypeId == 10) {
				value.subparams.push(value.Snd.sph);
				value.subparams.push(value.Snd.cyl);
			} else if (value.Products.TypeId == 30) {
				value.subparams.push(value.Snd.model);
				value.subparams.push(value.Snd.color);
				if (value.Snd.size) {
					value.subparams.push(value.Snd.size);
				}
			} else if (value.Products.TypeId == 41) {
				value.subparams.push(value.Snd.model);
				value.subparams.push(value.Snd.color);
				if (value.Snd.size) {
					value.subparams.push(value.Snd.size);
				}
				if (value.Snd.function_info) {
					value.subparams.push(value.Snd.function_info);
				}
			} else if (value.Products.TypeId  == 40) {
				value.subparams.push(value.Snd.sph);
				value.subparams.push(value.Snd.add);
			} else if (value.Products.TypeId  == 20) {
				value.subparams.push(value.Snd.sph);
				value.subparams.push(value.Snd.cyl);
			}
			addGoods(value);
		});

	}, 'json');
	
});

var to_print = function () {
	createRetailPrinter({'archives':archives, 'optometry':optometry, 'retail':retail, 'retail_data':retail_data});
};

var addGoods = function (goods) {
	var box = $(".template").clone();
	box.removeClass("template");
	/*********************************************/
	box.find(".item-field > h4 > a").text(goods.Products.Name);
	box.find(".form-goods > .formline > span[class='order-number am-margin-right-sm']").text("X"+goods.Amount);
	box.find(".price-info .form-goods > .formline > .price-red").text("￥" + formatnumber(goods.TotalPrice, "#,##0.00"));
	box.find(".price-info .form-goods > .formline > .am-margin-left-sm").text("折扣率"+goods.DiscountRate+"%");
	if(goods.Inventory.Acceptance) {
		if(goods.Inventory.Acceptance.Id == 0){
			box.find(".price-info a[type='lot_number']").parent().remove();
			box.find("td:last").find(".btnbar").remove();
		}else {
			box.find(".price-info a[type='lot_number']").text("批号:"+goods.Inventory.Acceptance.lot_number+' 有效期：'+timetransDate(goods.Inventory.Acceptance.expiry_date));
		}
	}
	box.find(".price-info .form-goods > .formline > input[name='collect_goods_num']").val(goods.Amount);
	box.find(".price-info .form-goods > .formline > input[name='collect_goods_num']").attr("readonly","readonly");
	box.find(".price-info .form-goods > .formline > input[name='collect_goods_num']").css("background-color","#eeeeee");

	for (var o in goods.subparams) {
		box.find(".item-field > .par > li").append("<span>" + goods.subparams[o] + "</span>");
	}
	if (!goods.goods_custom_id) {
		box.find(".customize-tips").hide();
	}
	$(".datalist-goods > tbody").append(box);
	box.show();
};

var addlog = function (logs) {
	var timeline = $('#timeline').html('');
	var join = [];
	$.each(logs, function (idx, value) {
		join.push('<li><span class="time">'+ timetrans(value.CreatedAt) +'</span>'+ value.Content +'</li>')
	});
	$('#timeline').html(join.join(''));
};

var addOptometry = function(record) {
	var html=[];
	var id = "'"+record.id+"'";
	var chufang_type;
	var optometry_snd_id;
	html.push('<div class="ms">');
	if(record.near){
		chufang_type= "'near'";
		optometry_snd_id="'"+record.near.optometry_snd_id+"'";
		html.push('<div class="chufang">');
		html.push('<div class="title am-cf">');
		html.push('<h3>近用处方</h3>');
		html.push('</div>');
		html.push('<div class="datatable-shili" data-type="near" >');
		html.push('<div class="info-bar list-head am-cf">');
		html.push('<div class="item" style="width:11%">球镜</div>');
		html.push('<div class="item" style="width:11%">柱镜</div>');
		html.push('<div class="item" style="width:11%">轴位</div>');
		html.push('<div class="item" style="width:11%">瞳距(mm)</div>');
		html.push('<div class="item" style="width:11%">瞳高(mm)</div>');
		html.push('<div class="item" style="width:11%">裸眼视力</div>');
		html.push('<div class="item" style="width:11%">矫正视力</div>');
		html.push('<div class="item" style="width:11%">棱镜</div>');
		html.push('<div class="item" style="width:11%">基底</div>');
		html.push('</div>');
		html.push('<div class="info-bar blue-bg am-cf" data-type="right">');
		html.push(record.near.right.sph?'<div class="item" data-type="sph" style="width:11%">'+record.near.right.sph+'</div>':'<div class="item" data-type="sph" style="width:11%"></div>');
		html.push(record.near.right.cyl?'<div class="item" data-type="cyl" style="width:11%">'+record.near.right.cyl+'</div>':'<div class="item" data-type="cyl" style="width:11%"></div>');
		html.push(record.near.right.axial_view?'<div class="item" data-type="axial_view" style="width:11%">'+record.near.right.axial_view+'</div>':'<div class="item" data-type="axial_view" style="width:11%"></div>');
		html.push(record.near.right.pd_jin?'<div class="item" data-type="pd_jin" style="width:11%">'+record.near.right.pd_jin+'</div>':'<div class="item" data-type="pd_jin" style="width:11%"></div>');
		html.push(record.near.right.mrp?'<div class="item" data-type="mrp" style="width:11%">'+record.near.right.mrp+'</div>':'<div class="item" data-type="mrp" style="width:11%"></div>');
		html.push(record.near.right.nv?'<div class="item" data-type="nv" style="width:11%">'+record.near.right.nv+'</div>':'<div class="item" data-type="nv" style="width:11%"></div>');
		html.push(record.near.right.cv?'<div class="item" data-type="cv" style="width:11%">'+record.near.right.cv+'</div>':'<div class="item" data-type="cv" style="width:11%"></div>');
		html.push(record.near.right.v?'<div class="item" data-type="v" style="width:11%">'+record.near.right.v+'</div>':'<div class="item" data-type="v" style="width:11%"></div>');
		html.push(record.near.right.bc?'<div class="item" data-type="bc" style="width:11%">'+record.near.right.bc+'</div>':'<div class="item" data-type="bc" style="width:11%"></div>');
		html.push('<span class="type blue">右眼</span>');
		html.push('</div>');
		html.push('<div class="info-bar red-bg am-cf" data-type="left">');
		html.push(record.near.left.sph?'<div class="item" data-type="sph" style="width:11%">'+record.near.left.sph+'</div>':'<div class="item" data-type="sph" style="width:11%"></div>');
		html.push(record.near.left.cyl?'<div class="item" data-type="cyl" style="width:11%">'+record.near.left.cyl+'</div>':'<div class="item" data-type="cyl" style="width:11%"></div>');
		html.push(record.near.left.axial_view?'<div class="item" data-type="axial_view" style="width:11%">'+record.near.left.axial_view+'</div>':'<div class="item" data-type="axial_view" style="width:11%"></div>');
		html.push(record.near.left.pd_jin?'<div class="item" data-type="pd_jin" style="width:11%">'+record.near.left.pd_jin+'</div>':'<div class="item" data-type="pd_jin" style="width:11%"></div>');
		html.push(record.near.left.mrp?'<div class="item" data-type="mrp" style="width:11%">'+record.near.left.mrp+'</div>':'<div class="item" data-type="mrp" style="width:11%"></div>');
		html.push(record.near.left.nv?'<div class="item" data-type="nv" style="width:11%">'+record.near.left.nv+'</div>':'<div class="item" data-type="nv" style="width:11%"></div>');
		html.push(record.near.left.cv?'<div class="item" data-type="cv" style="width:11%">'+record.near.left.cv+'</div>':'<div class="item" data-type="cv" style="width:11%"></div>');
		html.push(record.near.left.v?'<div class="item" data-type="v" style="width:11%">'+record.near.left.v+'</div>':'<div class="item" data-type="v" style="width:11%"></div>');
		html.push(record.near.left.bc?'<div class="item" data-type="bc" style="width:11%">'+record.near.left.bc+'</div>':'<div class="item" data-type="bc" style="width:11%"></div>');
		html.push('<span class="type red">左眼</span>');
		html.push('</div>');
		html.push('<div class="info-bar define-row col4 am-cf">');
		html.push('<div class="item"><div class="pmr" data-type="total_pd_jin"><span>总近用瞳距:</span><b>'+record.near.tongju_jin+'</b>mm</div></div>');
		html.push('</div>');
		html.push('</div>');
		html.push('</div>');
	}
	if(record.far){
		chufang_type= "'far'";
		optometry_snd_id="'"+record.far.optometry_snd_id+"'";
		html.push('<div class="chufang">');
		html.push('<div class="title am-cf">');
		html.push('<h3>远用处方</h3>');
		html.push('</div>');
		html.push('<div class="datatable-shili" data-type="far" >');
		html.push('<div class="info-bar list-head am-cf">');
		html.push('<div class="item" style="width:11%">球镜</div>');
		html.push('<div class="item" style="width:11%">柱镜</div>');
		html.push('<div class="item" style="width:11%">轴位</div>');
		html.push('<div class="item" style="width:11%">瞳距(mm)</div>');
		html.push('<div class="item" style="width:11%">瞳高(mm)</div>');
		html.push('<div class="item" style="width:11%">裸眼视力</div>');
		html.push('<div class="item" style="width:11%">矫正视力</div>');
		html.push('<div class="item" style="width:11%">棱镜</div>');
		html.push('<div class="item" style="width:11%">基底</div>');
		html.push('</div>');
		html.push('<div class="info-bar blue-bg am-cf" data-type="right">');
		html.push(record.far.right.sph?'<div class="item" data-type="sph" style="width:11%">'+record.far.right.sph+'</div>':'<div class="item" data-type="sph" style="width:11%"></div>');
		html.push(record.far.right.cyl?'<div class="item" data-type="cyl" style="width:11%">'+record.far.right.cyl+'</div>':'<div class="item" data-type="cyl" style="width:11%"></div>');
		html.push(record.far.right.axial_view?'<div class="item" data-type="axial_view" style="width:11%">'+record.far.right.axial_view+'</div>':'<div class="item" data-type="axial_view" style="width:11%"></div>');
		html.push(record.far.right.pd_yuan?'<div class="item" data-type="pd_jin" style="width:11%">'+record.far.right.pd_yuan+'</div>':'<div class="item" data-type="pd_jin" style="width:11%"></div>');
		html.push(record.far.right.mrp?'<div class="item" data-type="mrp" style="width:11%">'+record.far.right.mrp+'</div>':'<div class="item" data-type="mrp" style="width:11%"></div>');
		html.push(record.far.right.nv?'<div class="item" data-type="nv" style="width:11%">'+record.far.right.nv+'</div>':'<div class="item" data-type="nv" style="width:11%"></div>');
		html.push(record.far.right.cv?'<div class="item" data-type="cv" style="width:11%">'+record.far.right.cv+'</div>':'<div class="item" data-type="cv" style="width:11%"></div>');
		html.push(record.far.right.v?'<div class="item" data-type="v" style="width:11%">'+record.far.right.v+'</div>':'<div class="item" data-type="v" style="width:11%"></div>');
		html.push(record.far.right.bc?'<div class="item" data-type="bc" style="width:11%">'+record.far.right.bc+'</div>':'<div class="item" data-type="bc" style="width:11%"></div>');
		html.push('<span class="type blue">右眼</span>');
		html.push('</div>');
		html.push('<div class="info-bar red-bg am-cf" data-type="left">');
		html.push(record.far.left.sph?'<div class="item" data-type="sph" style="width:11%">'+record.far.left.sph+'</div>':'<div class="item" data-type="sph" style="width:11%"></div>');
		html.push(record.far.left.cyl?'<div class="item" data-type="cyl" style="width:11%">'+record.far.left.cyl+'</div>':'<div class="item" data-type="cyl" style="width:11%"></div>');
		html.push(record.far.left.axial_view?'<div class="item" data-type="axial_view" style="width:11%">'+record.far.left.axial_view+'</div>':'<div class="item" data-type="axial_view" style="width:11%"></div>');
		html.push(record.far.left.pd_yuan?'<div class="item" data-type="pd_jin" style="width:11%">'+record.far.left.pd_yuan+'</div>':'<div class="item" data-type="pd_jin" style="width:11%"></div>');
		html.push(record.far.left.mrp?'<div class="item" data-type="mrp" style="width:11%">'+record.far.left.mrp+'</div>':'<div class="item" data-type="mrp" style="width:11%"></div>');
		html.push(record.far.left.nv?'<div class="item" data-type="nv" style="width:11%">'+record.far.left.nv+'</div>':'<div class="item" data-type="nv" style="width:11%"></div>');
		html.push(record.far.left.cv?'<div class="item" data-type="cv" style="width:11%">'+record.far.left.cv+'</div>':'<div class="item" data-type="cv" style="width:11%"></div>');
		html.push(record.far.left.v?'<div class="item" data-type="v" style="width:11%">'+record.far.left.v+'</div>':'<div class="item" data-type="v" style="width:11%"></div>');
		html.push(record.far.left.bc?'<div class="item" data-type="bc" style="width:11%">'+record.far.left.bc+'</div>':'<div class="item" data-type="bc" style="width:11%"></div>');
		html.push('<span class="type red">左眼</span>');
		html.push('</div>');
		html.push('<div class="info-bar define-row col4 am-cf">');
		html.push('<div class="item"><div class="pmr" data-type="total_pd_yuan"><span>总远用瞳距:</span><b>'+record.far.tongju_yuan+'</b>mm</div></div>');
		html.push('</div>');
		html.push('</div>');
		html.push('</div>');
	}
	if(record.yinxing){
		chufang_type= "'yinxing'";
		optometry_snd_id="'"+record.yinxing.optometry_snd_id+"'";
		html.push('<div class="chufang">');
		html.push('<div class="title am-cf">');
		html.push('<h3>隐形处方</h3>');
		html.push('</div>');
		html.push('<div class="datatable-shili" data-type="yinxing" >');
		html.push('<div class="info-bar list-head am-cf">');
		html.push('<div class="item" style="width:11%">球镜</div>');
		html.push('<div class="item" style="width:11%">柱镜</div>');
		html.push('<div class="item" style="width:11%">轴位</div>');
		html.push('<div class="item" style="width:11%">瞳距(mm)</div>');
		html.push('<div class="item" style="width:11%">瞳高(mm)</div>');
		html.push('<div class="item" style="width:11%">裸眼视力</div>');
		html.push('<div class="item" style="width:11%">矫正视力</div>');
		html.push('<div class="item" style="width:11%">直径</div>');
		html.push('<div class="item" style="width:11%">基弧</div>');
		html.push('</div>');
		html.push('<div class="info-bar blue-bg am-cf" data-type="right">');
		html.push(record.yinxing.right.sph?'<div class="item" data-type="sph" style="width:11%">'+record.yinxing.right.sph+'</div>':'<div class="item" data-type="sph" style="width:11%"></div>');
		html.push(record.yinxing.right.cyl?'<div class="item" data-type="cyl" style="width:11%">'+record.yinxing.right.cyl+'</div>':'<div class="item" data-type="cyl" style="width:11%"></div>');
		html.push(record.yinxing.right.axial_view?'<div class="item" data-type="axial_view" style="width:11%">'+record.yinxing.right.axial_view+'</div>':'<div class="item" data-type="axial_view" style="width:11%"></div>');
		html.push(record.yinxing.right.pd_jin?'<div class="item" data-type="pd_jin" style="width:11%">'+record.yinxing.right.pd_jin+'</div>':'<div class="item" data-type="pd_jin" style="width:11%"></div>');
		html.push(record.yinxing.right.mrp?'<div class="item" data-type="mrp" style="width:11%">'+record.yinxing.right.mrp+'</div>':'<div class="item" data-type="mrp" style="width:11%"></div>');
		html.push(record.yinxing.right.nv?'<div class="item" data-type="nv" style="width:11%">'+record.yinxing.right.nv+'</div>':'<div class="item" data-type="nv" style="width:11%"></div>');
		html.push(record.yinxing.right.cv?'<div class="item" data-type="cv" style="width:11%">'+record.yinxing.right.cv+'</div>':'<div class="item" data-type="cv" style="width:11%"></div>');
		html.push(record.yinxing.right.diameter?'<div class="item" data-type="diameter" style="width:11%">'+record.yinxing.right.diameter+'</div>':'<div class="item" data-type="diameter" style="width:11%"></div>');
		html.push(record.yinxing.right.base_curve?'<div class="item" data-type="base_curve" style="width:11%">'+record.yinxing.right.base_curve+'</div>':'<div class="item" data-type="base_curve" style="width:11%"></div>');
		html.push('<span class="type blue">右眼</span>');
		html.push('</div>');
		html.push('<div class="info-bar red-bg am-cf" data-type="left">');
		html.push(record.yinxing.left.sph?'<div class="item" data-type="sph" style="width:11%">'+record.yinxing.left.sph+'</div>':'<div class="item" data-type="sph" style="width:11%"></div>');
		html.push(record.yinxing.left.cyl?'<div class="item" data-type="cyl" style="width:11%">'+record.yinxing.left.cyl+'</div>':'<div class="item" data-type="cyl" style="width:11%"></div>');
		html.push(record.yinxing.left.axial_view?'<div class="item" data-type="axial_view" style="width:11%">'+record.yinxing.left.axial_view+'</div>':'<div class="item" data-type="axial_view" style="width:11%"></div>');
		html.push(record.yinxing.left.pd_jin?'<div class="item" data-type="pd_jin" style="width:11%">'+record.yinxing.left.pd_jin+'</div>':'<div class="item" data-type="pd_jin" style="width:11%"></div>');
		html.push(record.yinxing.left.mrp?'<div class="item" data-type="mrp" style="width:11%">'+record.yinxing.left.mrp+'</div>':'<div class="item" data-type="mrp" style="width:11%"></div>');
		html.push(record.yinxing.left.nv?'<div class="item" data-type="nv" style="width:11%">'+record.yinxing.left.nv+'</div>':'<div class="item" data-type="nv" style="width:11%"></div>');
		html.push(record.yinxing.left.cv?'<div class="item" data-type="cv" style="width:11%">'+record.yinxing.left.cv+'</div>':'<div class="item" data-type="cv" style="width:11%"></div>');
		html.push(record.yinxing.left.diameter?'<div class="item" data-type="diameter" style="width:11%">'+record.yinxing.left.diameter+'</div>':'<div class="item" data-type="diameter" style="width:11%"></div>');
		html.push(record.yinxing.left.base_curve?'<div class="item" data-type="bc" style="width:11%">'+record.yinxing.left.base_curve+'</div>':'<div class="item" data-type="base_curve" style="width:11%"></div>');
		html.push('<span class="type red">左眼</span>');
		html.push('</div>');
		html.push('</div>');
		html.push('</div>');
	}
	if(record.duojiaodian){
		chufang_type= "'duojiaodian'";
		optometry_snd_id="'"+record.duojiaodian.optometry_snd_id+"'";
		html.push('<div class="chufang">');
		html.push('<div class="title am-cf">');
		html.push('<h3>多焦点处方</h3>');
		html.push('</div>');
		html.push('<div class="datatable-shili" data-type="duojiaodian" >');
		html.push('<div class="info-bar list-head am-cf">');
		html.push('<div class="item" style="width:8.3%">球镜</div>');
		html.push('<div class="item" style="width:8.3%">柱镜</div>');
		html.push('<div class="item" style="width:8.3%">轴位</div>');
		html.push('<div class="item" style="width:8.3%">近瞳距(mm)</div>');
		html.push('<div class="item" style="width:8.3%">远瞳距(mm)</div>');
		html.push('<div class="item" style="width:8.3%">瞳高(mm)</div>');
		html.push('<div class="item" style="width:8.3%">裸眼视力</div>');
		html.push('<div class="item" style="width:8.3%">矫正视力</div>');
		html.push('<div class="item" style="width:8.3%">ADD</div>');
		html.push('<div class="item" style="width:8.3%">通道</div>');
		html.push('<div class="item" style="width:8.3%">棱镜</div>');
		html.push('<div class="item" style="width:8.3%">基底</div>');
		html.push('</div>');
		html.push('<div class="info-bar blue-bg am-cf" data-type="right">');
		html.push(record.duojiaodian.right.sph?'<div class="item" data-type="sph" style="width:8.3%">'+record.duojiaodian.right.sph+'</div>':'<div class="item" data-type="sph" style="width:8.3%"></div>');
		html.push(record.duojiaodian.right.cyl?'<div class="item" data-type="cyl" style="width:8.3%">'+record.duojiaodian.right.cyl+'</div>':'<div class="item" data-type="cyl" style="width:8.3%"></div>');
		html.push(record.duojiaodian.right.axial_view?'<div class="item" data-type="axial_view" style="width:8.3%">'+record.duojiaodian.right.axial_view+'</div>':'<div class="item" data-type="axial_view" style="width:8.3%"></div>');
		html.push(record.duojiaodian.right.pd_jin?'<div class="item" data-type="pd_jin" style="width:8.3%">'+record.duojiaodian.right.pd_jin+'</div>':'<div class="item" data-type="pd_jin" style="width:8.3%"></div>');
		html.push(record.duojiaodian.right.pd_yuan?'<div class="item" data-type="pd_yuan" style="width:8.3%">'+record.duojiaodian.right.pd_yuan+'</div>':'<div class="item" data-type="pd_yuan" style="width:8.3%"></div>');
		html.push(record.duojiaodian.right.mrp?'<div class="item" data-type="mrp" style="width:8.3%">'+record.duojiaodian.right.mrp+'</div>':'<div class="item" data-type="mrp" style="width:8.3%"></div>');
		html.push(record.duojiaodian.right.nv?'<div class="item" data-type="nv" style="width:8.3%">'+record.duojiaodian.right.nv+'</div>':'<div class="item" data-type="nv" style="width:8.3%"></div>');
		html.push(record.duojiaodian.right.cv?'<div class="item" data-type="cv" style="width:8.3%">'+record.duojiaodian.right.cv+'</div>':'<div class="item" data-type="cv" style="width:8.3%"></div>');
		html.push(record.duojiaodian.right.add_info?'<div class="item" data-type="add_info" style="width:8.3%">'+record.duojiaodian.right.add_info+'</div>':'<div class="item" data-type="add_info" style="width:8.3%"></div>');
		html.push(record.duojiaodian.right.pass?'<div class="item" data-type="pass" style="width:8.3%">'+record.duojiaodian.right.pass+'</div>':'<div class="item" data-type="pass" style="width:8.3%"></div>');
		html.push(record.duojiaodian.right.v?'<div class="item" data-type="v" style="width:8.3%">'+record.duojiaodian.right.v+'</div>':'<div class="item" data-type="v" style="width:8.3%"></div>');
		html.push(record.duojiaodian.right.bc?'<div class="item" data-type="bc" style="width:8.3%">'+record.duojiaodian.right.bc+'</div>':'<div class="item" data-type="bc" style="width:8.3%"></div>');
		html.push('<span class="type blue">右眼</span>');
		html.push('</div>');
		html.push('<div class="info-bar red-bg am-cf" data-type="left">');
		html.push(record.duojiaodian.left.sph?'<div class="item" data-type="sph" style="width:8.3%">'+record.duojiaodian.left.sph+'</div>':'<div class="item" data-type="sph" style="width:8.3%"></div>');
		html.push(record.duojiaodian.left.cyl?'<div class="item" data-type="cyl" style="width:8.3%">'+record.duojiaodian.left.cyl+'</div>':'<div class="item" data-type="cyl" style="width:8.3%"></div>');
		html.push(record.duojiaodian.left.axial_view?'<div class="item" data-type="axial_view" style="width:8.3%">'+record.duojiaodian.left.axial_view+'</div>':'<div class="item" data-type="axial_view" style="width:8.3%"></div>');
		html.push(record.duojiaodian.left.pd_jin?'<div class="item" data-type="pd_jin" style="width:8.3%">'+record.duojiaodian.left.pd_jin+'</div>':'<div class="item" data-type="pd_jin" style="width:8.3%"></div>');
		html.push(record.duojiaodian.left.pd_yuan?'<div class="item" data-type="pd_yuan" style="width:8.3%">'+record.duojiaodian.left.pd_yuan+'</div>':'<div class="item" data-type="pd_yuan" style="width:8.3%"></div>');
		html.push(record.duojiaodian.left.mrp?'<div class="item" data-type="mrp" style="width:8.3%">'+record.duojiaodian.left.mrp+'</div>':'<div class="item" data-type="mrp" style="width:8.3%"></div>');
		html.push(record.duojiaodian.left.nv?'<div class="item" data-type="nv" style="width:8.3%">'+record.duojiaodian.left.nv+'</div>':'<div class="item" data-type="nv" style="width:8.3%"></div>');
		html.push(record.duojiaodian.left.cv?'<div class="item" data-type="cv" style="width:8.3%">'+record.duojiaodian.left.cv+'</div>':'<div class="item" data-type="cv" style="width:8.3%"></div>');
		html.push(record.duojiaodian.left.add_info?'<div class="item" data-type="add_info" style="width:8.3%">'+record.duojiaodian.left.add_info+'</div>':'<div class="item" data-type="add_info" style="width:8.3%"></div>');
		html.push(record.duojiaodian.left.pass?'<div class="item" data-type="pass" style="width:8.3%">'+record.duojiaodian.left.pass+'</div>':'<div class="item" data-type="pass" style="width:8.3%"></div>');
		html.push(record.duojiaodian.left.v?'<div class="item" data-type="v" style="width:8.3%">'+record.duojiaodian.left.v+'</div>':'<div class="item" data-type="v" style="width:8.3%"></div>');
		html.push(record.duojiaodian.left.bc?'<div class="item" data-type="bc" style="width:8.3%">'+record.duojiaodian.left.bc+'</div>':'<div class="item" data-type="bc" style="width:8.3%"></div>');
		html.push('<span class="type red">左眼</span>');
		html.push('</div>');
		html.push('<div class="info-bar define-row col4 am-cf">');
		html.push('<div class="item"><div class="pmr" data-type="total_pd_jin"><span>总近用瞳距:</span><b>'+record.duojiaodian.tongju_jin+'</b>mm</div></div>');
		html.push('<div class="item"><div class="pmr" data-type="total_pd_yuan"><span>总远用瞳距:</span><b>'+record.duojiaodian.tongju_yuan+'</b>mm</div></div>');
		html.push('</div>');
		html.push('</div>');
		html.push('</div>');
	}
	html.push('</div>');
	html.push('</div>');
	return html.join("");
};